<template>
    <div class="navbar" @click="go_back()">
        <img src="../assets/img/daohang.png" alt="导航" class="navbar_img">
    </div>
    <!-- 导航栏 结束 -->
    <div class="settlement">
        <div class="box" id="box">
            <div class="box-core">
                <div class="tick">
                    <div class="tick-core"></div>
                </div>
            </div>
        </div>
        <span style="color: #303133;font-weight: bold; font-size: 16px">
            <p style="text-align: center;">不是哥们</p>
            <p style="text-align: center;">这个你都整完了？那可以说真的牛</p>
        </span>
    </div>
    
</template>

<script setup>
import { useRouter } from 'vue-router'

// 使用 useRouter 创建一个 router 实例
const router = useRouter()

function go_back(){
    // 返回上一页
    router.push({ path: '/' })
}
</script>

<style lang="scss" scoped>
%center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.settlement {
  min-height: 100vh;
  background: linear-gradient(135deg, #f6f8fc, #e9ecef);
  position: relative;
  overflow: hidden;
  @extend %center;
  flex-direction: column;
  padding: 20px;
  animation: fadeIn 0.8s ease;

  // 添加背景装饰
  &::before, &::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
    z-index: 0;
  }

  &::before {
    top: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite;
  }

  &::after {
    bottom: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite 1s;
  }
}

.navbar {
  z-index: 99;
  position: fixed;
  top: 20px;
  left: 20px;
  width: 45px;
  height: 45px;
  padding: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  animation: slideIn 0.5s ease-out;

  &:hover {
    transform: rotate(90deg);
    background: white;
  }

  .navbar_img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

.box {
  position: relative;
  top: 50%;
  left: 0%;
  width: 120px;
  height: 120px;
  margin: 30px 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5);
  @extend %center;
  z-index: 1;
  animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

  .box-core {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    @extend %center;
    position: relative;
    overflow: hidden;

    &::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.4));
    }
  }

  .tick {
    width: 40px;
    height: 70px;
    border-right: 6px solid #22c55e;
    border-bottom: 6px solid #22c55e;
    transform: rotate(45deg);
    margin-top: -20px;
    animation: checkmark 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  }
}

span {
  margin-top: 30px;
  text-align: center;
  z-index: 1;
  
  p {
    margin: 10px 0;
    font-size: 18px;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease forwards;

    &:first-child {
      animation-delay: 0.3s;
      font-size: 24px;
      background: linear-gradient(135deg, #6366f1, #4f46e5);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    &:last-child {
      animation-delay: 0.5s;
    }
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes checkmark {
  0% {
    opacity: 0;
    transform: rotate(45deg) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: rotate(45deg) scale(1.2);
  }
  100% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
</style>